<p id="notice"><%= notice %></p>
<div id="user_account">
  <h1>User details</h1>
  <%= link_to "Go back to USERS", users_path %>
  <p style="margin-left:48em">Click to edit</p>
  <table>
    <tr>
      <td id="name">
        <%= best_in_place @user, :name, url: {action: :update} , param: :admin %>
      </td>
    </tr>
    <tr>
      <td>Last Name</td>
      <td id="last_name">
        <%= best_in_place [:admin, @user], :last_name, place_holder: 'Nothing to show' , param: :admin %>
      </td>
    </tr>
  </table>

  <table id="test-results-table">
    <% @user.tests.each do |test| %>
      <tr>
        <td><%= test.name %></td>
        <td>
          <%= best_in_place [:admin, test], :result, as: test.options ? :select : :input,
                                                     collection: test.options,
                                                     id: "best_in_place_test_result_#{test.name_to_slug}_result"
          %>
        </td>
      </tr>
    <% end %>
  </table>
</div>

